package com.project.im.common.exception;

import com.project.im.common.enums.ResponseCode;
import lombok.Getter;

@Getter
public class WebException extends RuntimeException {
    private final String code;

    public WebException(String code, String msg) {
        super(msg);
        this.code = code;
    }

    public WebException(ResponseCode responseCode) {
        super(responseCode.getMsg());
        this.code = responseCode.getCode();
    }

    public WebException(String msg) {
        super(msg);
        this.code = ResponseCode.FAIL.getCode();
    }
}
